package com.dzpk.gameserver.module.main;

/**
 * Created by somnus on 16/10/8.
 */

import com.dzpk.gameserver.module.main.room.Room;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;


/**
 * <p>Title: Cache</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * @author shenxing.ruan
 * @version 1.0
 */
public class Cache {
    private static Map<Long, Room> rooms = new ConcurrentHashMap<Long, Room>(1000);
    /**
     * 在线用户 XXX
     */
    private static Map<Long, UserInfo> onlineUserInfo = new ConcurrentHashMap<Long, UserInfo>(5000);


    public static Map<Long, UserInfo> getOnlineUserInfo() {
        return onlineUserInfo;
    }






    public static Room getRoom(long roomId){
        return rooms.get(roomId);
    }

    public static void deleteRoom(long roomId){
        rooms.remove(roomId);
    }

    public static void addRoom(Room room){
        rooms.put(room.getRoomId(), room);
    }

}

